<template>
  <div class="app-container" v-loading="!url">
    <iframe
      :src="url"
      frameborder="no"
      style="width: 100%; height: 100%"
      scrolling="auto"
    />
  </div>
</template>

<script>
// import { RunningToken } from '@/api/login'
import axios from 'axios'
export default {
  name: 'Running',
  data() {
    return {
      url: ''
      // 'http://tunnel.piercingeyes.cn/www/#/dashboard/state?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbmNEYXRhIjoiZGM5MDIyM2E4MTlkODM1ZTM0YjRkNTUzZTRkM2NmYjU0N2I4ODk0NTg0YmZkZDI1MGE5NGVmM2ZmYzJlMzdiYWYwYzQ2NjAwYzdjNWMwN2NiNjQ0YzgyZTljNjc0ZWExYjhmZmQ5YTgwZjUwZjc0MGU2ZDQxODk3ZDMzMDM5NWEzNGU0NTY4NjYzODA2NGI0YjM4ZjQyYTVkYTIxYzU5NjZlMDlhODFjNGVkMTc0ZGJkZTAwMjQ3NjU2OTE4YjEwIn0.iA9cAf4E0FTtCpWXpKUAx4OX0f33o-JW5rZRKYTzKiM'
    // url: 'http://tunnel.piercingeyes.cn/www/#/dashboard/state?token=' + RunningToken
    }
  },
  created() {
    this.getToken()
  },
  methods: {
    getToken() {
      axios.post('http://tunnel.piercingeyes.cn/v1/api/getToken', {
        'username': 'show',
        'password': 'show@Test.2022#'
      }).then(res => {
        if (res.data.status == 0) {
          this.url = `http://tunnel.piercingeyes.cn/www/#/dashboard/state?token=${res.data.token}`
        }
      })
    }
  }
}
</script>

